package com.cyanite.playlv2api.parsers.json;

import com.cyanite.playlv2api.types.Settings;

import org.json.JSONException;
import org.json.JSONObject;

public class SettingsParser extends AbstractParser<Settings> {
    
    @Override
    public Settings parse(JSONObject json) throws JSONException {
        Settings obj = new Settings();
        if (json.has("feeds_key")) {
            obj.setFeedsKey(json.getString("feeds_key"));
        } 
        if (json.has("get_pings")) {
            obj.setGetPings(json.getBoolean("get_pings"));
        } 
        if (json.has("pings")) {
            obj.setPings(json.getString("pings"));
        }
        
        return obj;
    }
}